home *** CD-ROM | disk | FTP | other *** search
/ Scene Storm / Scene Storm - Volume 1.iso / coding / asm / utils / crossword / includes / cwextras.i < prev    next >
Encoding:
Text File  |  1980-01-04  |  3.9 KB  |  215 lines

  1.  
  2.  
  3. * Anciliary routines go in this file.
  4.  
  5.  
  6. * InitUndo(a6)
  7. * a6 = ptr to main program variables
  8.  
  9. * Initialise Undo array.
  10.  
  11.  
  12. InitUndo        move.l    undo_array(a6),a0        ;ptr to undo array
  13.         moveq    #" ",d2
  14.  
  15.         move.w    grid_down(a6),d0        ;vertical size
  16.         bra.s    IUN_a1
  17.  
  18. IUN_l1        move.w    grid_across(a6),d1    ;horiz size
  19.         bra.s    IUN_a2
  20.  
  21. IUN_l2        move.w    d2,(a0)+        ;insert space
  22.  
  23. IUN_a2        dbra    d1,IUN_l2    ;do this many across
  24.  
  25. IUN_a1        dbra    d0,IUN_l1    ;do this many down
  26.  
  27.         rts
  28.  
  29.  
  30. * SetEditing(a6)
  31. * a6 = ptr to main program variables
  32.  
  33. * Change editing state according to status of the
  34. * SELECTED flag of the new Grid Editing switch (as
  35. * it's a TOGGLESELECT job).
  36.  
  37. * d0/a0 corrupt
  38.  
  39.  
  40. SetEditing    move.l    gadget_id(a6),d0        ;got gadget?
  41.         beq.s    SEDT_Done        ;oops..
  42.         move.l    d0,a0
  43.         move.w    gg_Flags(a0),d0        ;get flags
  44.         and.w    #SELECTED,d0        ;SELECTED state?
  45.         sne    d0            ;make edit state byte
  46.         move.b    d0,editon(a6)        ;set editing state
  47.  
  48. SEDT_Done    rts
  49.  
  50.  
  51.  
  52. * HangPointer(a6)
  53. * a6 = ptr to main program variables
  54.  
  55. * Sets screen mouse pointer to "PLEASE WAIT"
  56. * as a sign that something processor-intensive
  57. * is about to happen.
  58.  
  59. * d0-d3/a0-a1 corrupt
  60.  
  61.  
  62. HangPointer    move.l    mw_handle(a6),a0
  63.         lea    CWHangPtr,a1
  64.         moveq    #49,d0        ;height
  65.         moveq    #16,d1        ;width
  66.         moveq    #0,d2        ;XOffset to HotSpot
  67.         moveq    #0,d3        ;YOffset to HotSpot
  68.         CALLINT    SetPointer
  69.  
  70.         rts
  71.  
  72.  
  73. * MainPointer(a6)
  74. * a6 = ptr to main program variables
  75.  
  76. * Sets main program pointer on screen.
  77.  
  78. * d0-d3/a0-a1 corrupt
  79.  
  80.  
  81. MainPointer    move.l    mw_handle(a6),a0
  82.         lea    CWPointer,a1
  83.         moveq    #15,d0        ;height
  84.         moveq    #16,d1        ;width
  85.         moveq    #0,d2        ;XOffset to HotSpot
  86.         moveq    #-12,d3        ;YOffset to HotSpot
  87.         CALLINT    SetPointer
  88.  
  89.         rts
  90.  
  91.  
  92. * DiscPointer(a6)
  93. * a6 = ptr to main program variables
  94.  
  95. * Sets main program pointer on screen.
  96.  
  97. * d0-d3/a0-a1 corrupt
  98.  
  99.  
  100. DiscPointer    move.l    dp_window1(a6),a0
  101.         lea    CWPointer,a1
  102.         moveq    #15,d0        ;height
  103.         moveq    #16,d1        ;width
  104.         moveq    #0,d2        ;XOffset to HotSpot
  105.         moveq    #-12,d3        ;YOffset to HotSpot
  106.         CALLINT    SetPointer
  107.  
  108.         move.l    dp_window2(a6),a0
  109.         lea    CWPointer,a1
  110.         moveq    #15,d0        ;height
  111.         moveq    #16,d1        ;width
  112.         moveq    #0,d2        ;XOffset to HotSpot
  113.         moveq    #-12,d3        ;YOffset to HotSpot
  114.         CALLINT    SetPointer
  115.  
  116.         rts
  117.  
  118.  
  119. * LinkFonts(a6)
  120. * a6 = ptr to main program variables
  121.  
  122. * Link the font pointer into all of the IntuiTexts that
  123. * need it.
  124.  
  125. * d0-d1/a0 corrupt
  126.  
  127.  
  128. LinkFonts    nop
  129.  
  130. ;        move.l    topaz_font(a6),d0    ;get font pointer
  131.  
  132.         lea    Topaz_80(pc),a0    ;ptr to font TextAttr
  133.         move.l    a0,d0
  134.  
  135.         lea    IRT_1(pc),a0    ;point to InfoReq ITexts
  136.         moveq    #20,d1        ;number to do
  137.  
  138. LFNT_1        move.l    d0,8(a0)        ;link in Font
  139.         add.w    #20,a0        ;point to next
  140.         subq.l    #1,d1        ;do this many
  141.         bne.s    LFNT_1        ;back until done
  142.  
  143.         lea    QRT_1(pc),a0    ;point to QueryReq ITexts
  144.         moveq    #20,d1        ;number to do
  145.  
  146. LFNT_2        move.l    d0,8(a0)        ;link in Font
  147.         add.w    #20,a0        ;point to next
  148.         subq.l    #1,d1        ;do this many
  149.         bne.s    LFNT_2        ;back until done
  150.  
  151.         rts
  152.  
  153.  
  154. * SetUnsolved(a6)
  155. * a6 = ptr to main program variables
  156.  
  157. * Set all entries in clue list to the unsolved state.
  158.  
  159. * d0/a0-a1 corrupt
  160.  
  161.  
  162. SetUnsolved    move.l    clue_list(a6),d0    ;get clue list
  163.         beq.s    SUS_4        ;exit if it doesn't exist
  164.  
  165.         move.l    d0,a0        ;else point to it
  166.  
  167.         move.l    clh_AcList(a0),d0    ;across list exists?
  168.         beq.s    SUS_2        ;skip if not
  169.  
  170.         move.l    d0,a1
  171.         move.w    clh_AcCount(a0),d0    ;else get entry count
  172.         
  173. SUS_1        clr.b    cle_Solved(a1)    ;set unsolved
  174.         add.w    #cle_sizeof,a1    ;point to next entry
  175.         subq.w    #1,d0
  176.         bne.s    SUS_1
  177.  
  178. SUS_2        move.l    clh_DnList(a0),d0    ;down list exists?
  179.         beq.s    SUS_4        ;skip if not
  180.  
  181.         move.l    d0,a1
  182.         move.w    clh_DnCount(a0),d0    ;else get entry count
  183.  
  184. SUS_3        clr.b    cle_Solved(a1)    ;set unsolved
  185.         add.w    #cle_sizeof,a1    ;point to next entry
  186.         subq.w    #1,d0
  187.         bne.s    SUS_3
  188.  
  189. SUS_4        rts
  190.  
  191.  
  192. * SodOff(a6)
  193. * a6 = ptr to main program variables
  194.  
  195. * Display the InfoReq for "Function Not Implemented".
  196.  
  197. * d0-a0-a1 corrupt
  198.  
  199.  
  200. SodOff        lea    NoGo(pc),a0
  201.         lea    IRT_1(pc),a1
  202.         moveq    #4,d0
  203.         move.l    a0,irt_tlist(a6)
  204.         move.l    a1,irt_itext(a6)
  205.         move.w    d0,irt_count(a6)
  206.  
  207.         bsr    LinkInfoText
  208.  
  209.         bsr    ShowInfoReq        ;pop up requester
  210.  
  211.         rts
  212.  
  213.  
  214.  
  215.